<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">

    <p:dialog header="Adauga/Editeaza experienta de lucru" widgetVar="add_work_experience_WV" dynamic="true"
              minHeight="300" width="600"
              modal="true">

        <h:form id="create_work_experience_form">

            <h:panelGrid columns="2" columnClasses="column-1, column-200" styleClass="form-elements">
                <p:outputLabel for="work_place" value="Locul de munca:"/>
                <p:inputText id="work_place" value="#{employmentDataBean.selectedWorkExperience.workPlace}"
                             required="true"/>

                <p:outputLabel for="we_position" value="Functia:"/>
                <p:inputText id="we_position" value="#{employmentDataBean.selectedWorkExperience.position}" required="true"/>

                <p:outputLabel for="we_from_date" value="Inceput activitate:"/>
                <p:calendar id="we_from_date" value="#{employmentDataBean.selectedWorkExperience.fromDate}"
                            required="true" pattern="dd/MM/yyyy"/>

                <p:outputLabel for="we_to_date" value="Sfarsit activitate:"/>
                <p:calendar id="we_to_date" value="#{employmentDataBean.selectedWorkExperience.toDate}"
                            required="true" pattern="dd/MM/yyyy"/>

                <p:outputLabel for="we_category" value="Tip:"/>
                <p:selectOneMenu id="we_category" value="#{employmentDataBean.selectedWorkExperience.workType}" required="true"
                                 style="width: 200px;" converter="#{objectMappingConverter}">
                    <f:selectItem itemLabel="Selectati tipul..."/>
                    <f:selectItems var="wk" value="#{employmentDataBean.workTypes}" itemLabel="#{wk.name}"
                                   itemValue="#{wk}"/>
                </p:selectOneMenu>

            </h:panelGrid>

            <p:outputPanel layout="block" style="border-top: 1px solid #A8A8A8; padding: 5px;">
                <p:commandButton icon="ui-icon-disk" value="Salveaza"
                                 update="@form :folder_details_content:folder_details_content:work_experiences_form"
                                 actionListener="#{employmentDataBean.saveWorkExperience}"
                                 oncomplete="if (args &amp;&amp; !args.validationFailed) add_work_experience_WV.hide()"/>
                <p:commandButton value="Renunta" onclick="PF('add_work_experience_WV').hide();" process="@none"/>
            </p:outputPanel>
        </h:form>
    </p:dialog>


</ui:composition>
